package day02;

import java.math.BigDecimal;

//本类是用来测试小数类型的演示demo
public class Test05 {
    public static void main(String[] args) {
        double a = 3.14;//声明double变量a赋值3.14；
        System.out.println(a);
        double b = 3.0;
        double c = 2.9;
        System.out.println(b - c);
        double e = 6.0;
        double f = 2.9;
        System.out.println(e - f);
        double g = 6.0;
        double h = 1.9;
        System.out.println(g - h);
        BigDecimal b1 =new BigDecimal("3.0");
        BigDecimal c1 =new BigDecimal("2.9");
        BigDecimal result =b1.subtract(c1);//针对浮点double不准确的精确计算方法
        System.out.println(result);
//unicode

    }
}
